<template>
    <div style="width: 100%;padding: 0 10px;height: 100%;">
        <List :data="data"></List>
    </div>
</template>

<script>
import List from '@/components/admin/userList.vue'
import { getUserInfo } from "@/api/index";
import { getObj } from '@/utils/index.js'

export default {
    name: 'AdminUser',
    data() {
        return {
            data: {
                data: [
                    {
                        user_id: 1,
                        name: '用户1',
                        phone: 6654545,
                        isadmin: false,
                        url: '',
                        zhanghao: '123456',
                        address: '啊啊撒旦看风景了'
                    }
                ],
                type: 'user'
            }
        }
    },
    components: {
        List
    },
    methods: {

    },
    mounted() {
        //  let data= await getUserInfo('/get')
        this.data = getObj([
            {
                user_id: 1,
                name: '用户1',
                phone: 6654545,
                isadmin: false,
                url: '',
                zhanghao: '123456',
                address: '啊啊撒旦看风景了'
            }
        ],['url', 'name', 'zhanghao', 'phone'],['头像', '用户名', '账户', '联系方式', '更多'])
        // this.data = {
        //     data: [
        //         {
        //             user_id: 1,
        //             name: '用户1',
        //             phone: 6654545,
        //             isadmin: false,
        //             url: '',
        //             zhanghao: '123456',
        //             address: '啊啊撒旦看风景了'
        //         }
        //     ],
        //     type: 'user',
        //     title: ['头像', '用户名', '账户', '联系方式', '更多']
        // }
    }
}
</script>

<style scoped>
.box {
    width: calc(100vw - 300px);
    background-color: #f9f9f9;
    padding: 10px;
    box-sizing: border-box;
}

.btn {
    display: flex;
    margin: 20px 0;
}

.btn input {
    width: 20% !important;
}
</style>